<template>
  <div class="login">
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="登录" name="first"
        ><Login v-if="sonRefresh" />
      </el-tab-pane>
      <el-tab-pane label="注册" name="second"><Register v-if="sonRefresh"/></el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import Login from "./Login";
import Register from "./Register";
export default {
  components: {
    Login,
    Register,
  },
  data() {
    return {
      activeName: "first",
      　sonRefresh: true,
    };
  },
  methods: {
    handleClick() {
      this.sonRefresh = false;
      this.$nextTick(() => {
        this.sonRefresh = true;
      });

      // console.log("+++++++", this.$refs.Login);
    },
  },
};
</script>

<style lang="less" scoped>
.login {
  width: 400px;
  height: 300px;
  margin: 200px auto;
  border: 1px solid #999999;
  padding: 5px 10px;
}
</style>